Script Functions
getcallingscript
Returns a script (or nil) that triggered the current code execution.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Returns a script (or nil) that triggered the current code execution.
function getcallingscript(): BaseScript?
local old = nil
old = hookmetamethod(game, "__namecall", function(self, ...)
local args = {...}
local method = getnamecallmethod()
if method == "FireServer" and self.Name == "Shoot" then
local script = getcallingscript()
if script and script.Name == "BulletService" then
args[2] = Vector3.zero
end
end
return old(self, table.unpack(args))
end)